home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2008 January / Cybermycha 1_2008.iso / Data.cab / _167C896A4D484BC588AFD0E4E758F600 < prev    next >
Encoding:
Text File  |  2004-03-18  |  1.1 KB  |  34 lines

  1. regc4f( 5, %daycolor_r, %daycolor_g, %daycolor_b, %sunvisibility )
  2. regc4f( 7, %ambient_r, %ambient_g, %ambient_b, %ambient_a )
  3.  
  4. pshader("
  5.  
  6. ps_1_4
  7.  
  8. texld r0, t0    ;RGB=terrain colormap, A=terrain lightmap
  9. texld r1, t1    ;terrain detail
  10. texld r2, t2    ;detailmasks
  11. texld r3, t3    ;clouds
  12. texld r4, t4    ;road
  13.  
  14.     dp3 r1.rgb, r1, r2            ;Mul details with masks                = DETAILS
  15.     +mul r0.a, 1-r3.a, r0.a     ;clouds shadow * terrain lightmap    = CLOUDS&LIGHTMAP
  16.  
  17.     mul r0.rgb, r0, r1          ;terrain color * blended details    = R0.RGB terrain
  18.     +mov_x4_sat r3.a, r4.a          ;road opacity mask              = R3.A road opacity mask
  19.  
  20.     lrp r0.rgb, r3.a, r4, r0    ;terrain color blend road with road opacity mask = terrain & road
  21.     +mul_sat r1.a, r4_bx2.a, c5.a     ;specular mask extraction
  22.  
  23.     mul r1.a, r1.a, r0.a         ;specular mask * static lighting    = R1.A Mask for specular
  24.  
  25.     mad_sat r0.rgb, v1, r1.a, r0    ;add specular
  26.     +mad_sat r0.a, r0.a, c7.b, c7.a ;ambient + static lighting       = R0.A static lighting
  27.  
  28.     mul r3.rgb, r0.a, c5            ;day * static lighting          = R4.RGB world lighting
  29.  
  30.     mul r0, r0, r3              ;light color
  31.  
  32. ")
  33.  
  34.